package com.idna.batchid.batch.job;

import java.util.List;

import org.springframework.batch.item.ItemWriter;

import com.idna.batchid.dao.RecordDao;
import com.idna.batchid.domain.Record;


public class DatabaseWriter implements ItemWriter<Record>
{
	private RecordDao<String, Record> dao;
	
	public void setDao(RecordDao<String, Record> dao)
	{
		this.dao = dao;
	}
	
	@Override
	public void write(List<? extends Record> items) throws Exception
	{
		for(Record record:items)
		{
			dao.save(record);
		}
	}

}
